vexilliumfandomcom-20200214-history
Template talk:Country
So, the REAL question is: how do I create a new infobox template? I've tried reading every ounce of Wiki's main help pages and there is nothing except vague references to it being possible and here's a sandbox. :As far as I know, you have to type the desired name in the URL box of your browser, and then go from there. For example, if I want to create a template called Whatever, I would have to manually go to "http://vexillium.wikia.com/wiki/Template:Whatever", which will present me with a screen saying "there's nothing here - do you want to make something?". (Is that what you mean?) -- Thomas Robinson 01:53, 21 May 2006 (UTC) ::Well, no, I mean the infoboxes, like the country one that we've all used over and over. I don't seem able to find a place in the Wiki where you edit how that works, how it puts the information into that table structure. For example, you type in "{ { countrycities infobox|" (spaces aside) and it knows to create two rows one for the capital, one for other cities, in the same box. You haven't specified that precise table structure, you've used a template. ::So, I'm wondering how to create just such a template, if possible, or whether they are pre-defined by Wiki, which would be fine, but I want to know their definitions, rules, all that. ::Making sense??? I know I can create the template with what you explain, but I have no idea what to do then or whether what I do will do what I am describing above. -- Mike Ham 01:52, 22 May 2006 (AEST) ::A good example of what I mean is the Utan Krysaror page, where I have tried to copy across the Australian Cities infobox from Wikipedia. :::I think I see what you're wondering about. Basically, the coding for the table is split up into the string of successive templates — when read together, all in a row, they make up a standard Wiki table. If we look at the code that makes a country infobox, for example: (etc...) :::Each of those things inside the brackets is a separate template. The template called "countrystart infobox" (located at Template:countrystart infobox) contains the coding for the start of the table, the "countryname infobox" (at Template:countryname infobox) template contains the coding for the first line of the table, and so forth — when processed all at once, they provide a full table from start to finish. :::As for feeding it information... some templates are completely pre-made, but it's also possible to specify a variable that is passed to the template from the main page's code. For example, the "countrystart infobox" template contains a variable called "name". If you look at the template's code, it reads: {| border=1 align=right cellpadding=2 cellspacing=0 width=300 (etc....) |+ } :::Most of that is just the code that makes the table itself, but there's also a thing marked " }" — this corresponds to the "name=" thing you can see in the first code example. The software simply drops whatever you type after "name=" in the place where the template says " }". The first line in the example is basically saying: Use the template called "countrystart infobox", and when that template asks for "name", tell it "Whatever". When you add all these little templates together, there's a complete table, with all the variables filled in. :::(You could, if you want, make a single template, containing the whole table and a pile of different variables. I believe the decision to use lots of little templates was in order to give flexibility — rows can be added and removed at will, without having to make two separate versions of the complete table. We may not have the same requirements, especially if it's something simple.) :::I hope that answers the question — sorry if I've misunderstood again. -- Thomas Robinson 10:43, 23 May 2006 (UTC)